﻿using BCCommon;
using BCCommon.Enums.Driver;
using BCCommon.TMS.Driver;
using BCDto.Sim.Admin.Admin;
using BCDto.TMS.Driver;
using BCDto.TMS.Driver.Horseman;
using BCDto.TMS.Driver.VehicleBusiness;
using BCDto.Website.User;
using System;
using System.Collections.Generic;

namespace BCService.TMS.Driver
{
    public interface IDriverService
    {

        /// <summary>
        /// 新增司机信息
        /// </summary>
        /// <param name="admin">当前登录员工</param>
        /// <param name="driverRequestDto">司机注册信息</param>
        /// <param name="ip">注册的IP地址</param>
        /// <returns></returns>
        DriverDto Add(AdminDto admin, DriverRequestDto driverRequestDto, string ip);
        /// <summary>
        /// 新增骑手信息
        /// </summary>
        /// <param name="admin">当前登录员工</param>
        /// <param name="horsemanRequestDto">骑手信息</param>
        /// <param name="ip">注册的IP地址</param>
        /// <returns></returns>
        DriverDto AddHorseman(AdminDto admin, HorsemanRequestDto horsemanRequestDto, string ip);

        /// <summary>
        /// 获取司机信息列表（分页）
        /// </summary>
        /// <param name="companyId">总公司/代理商Id</param>
        /// <param name="phone">手机</param>
        /// <param name="name">司机名</param>
        /// <param name="vehicleNo">车牌号</param>
        /// <param name="provinceCode">省编码</param>
        /// <param name="cityCode">市编码</param>
        /// <param name="countyCode">区县编码</param>
        /// <param name="driverStatus">审核状态</param>       
        /// <param name="role">司机角色</param>       
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>  
        /// <param name="ascending">是否升序排序</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">每页条数</param>
        PageableList<DriverDto> GetList(long? companyId, string phone, string name, string vehicleNo, string provinceCode, string cityCode, string countyCode, DriverStatus? driverStatus, DriverRoleType? role, DateTime? start, DateTime? end, bool? ascending, string sortName, int pageIndex, int pageSize);

        /// <summary>
        /// 根据手机号查询司机信息
        /// </summary>
        /// <param name="phone">手机号</param>
        /// <returns></returns>
        DriverDto GetDriverByPhone(string phone);
        /// <summary>
        /// 根据司机Id查询司机信息
        /// </summary>
        /// <param name="driverId">司机Id</param>
        /// <returns></returns>
        DriverDto GetDriverById(long driverId);
        /// <summary>
        /// 根据用户Id查询司机信息
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <returns></returns>
        DriverDto GetDriverByUserId(long userId);
        /// <summary>
        /// 根据车牌号查询司机信息
        /// </summary>
        /// <param name="vehicleNo">车牌号</param>
        /// <returns></returns>
        DriverDto GetDriverByVehicleNo(string vehicleNo);
        /// <summary>
        /// 用手机号和密码注册司机
        /// </summary>
        /// <param name="userRequestDto">用户注册信息</param> 
        /// <param name="ip">ip地址</param>
        /// <param name="driverSource">司机来源</param>
        /// <returns></returns>
        UserDto Register(UserRequestDto userRequestDto, string ip, DriverSourceType driverSource);

        /// <summary>
        /// 根据手机号和密码查询司机信息
        /// </summary>
        /// <param name="phone">手机号</param>
        /// <param name="paswword">密码</param>
        /// <returns></returns>
        DriverDto GetDriverByPhoneAndPassword(string phone, string paswword);
        /// <summary>
        /// 司机实名认证
        /// </summary>
        /// <param name="driverId">司机Id</param>
        /// <param name="dto">实名认证信息</param>
        /// <returns></returns>
        DriverDto RealNameVerifies(long driverId, RealNameVerifiesRequestDto dto);
        /// <summary>
        /// 司机人脸识别认证
        /// </summary>
        /// <param name="driverId">司机Id</param>
        /// <param name="dto">人脸识别认证信息</param>
        /// <returns></returns>
        DriverDto FaceVerifies(long driverId, FaceVerifiesRequestDto dto);

        /// <summary>
        /// 上传机动车辆信息
        /// </summary>
        /// <param name="driverId">司机Id</param>
        /// <param name="dto">机动车信息</param>
        /// <returns></returns>
        DriverDto UploadVehicle(long driverId, VehicleRequestDto dto);

        /// <summary>
        /// 上传电动车辆信息
        /// </summary>
        /// <param name="driverId">司机Id</param>
        /// <param name="dto">电动车辆信息</param>
        /// <returns></returns>
        DriverDto UploadElectricVehicle(long driverId, ElectricVehicleRequestDto dto);



        /// <summary>
        /// 切换城市信息
        /// </summary>
        /// <param name="driverId">司机Id</param>
        /// <param name="dto">城市信息</param>
        /// <returns></returns>
        DriverDto ChangeCity(long driverId, ChangeCityRequestDto dto);
        /// <summary>
        /// 实名认证审核
        /// </summary>
        /// <param name="admin">审核人员</param>
        /// <param name="driverId">司机信息</param>
        /// <param name="dto">审核信息</param>
        /// <returns></returns>
        DriverDto RealNameVerifiesApprove(AdminDto admin, long driverId, ApproveRequestDto dto);
        /// <summary>
        /// 人脸识别认证审核
        /// </summary>
        /// <param name="admin">审核人员</param>
        /// <param name="driverId">司机信息</param>
        /// <param name="dto">审核信息</param>
        /// <returns></returns>
        DriverDto FaceVerifiesApprove(AdminDto admin, long driverId, ApproveRequestDto dto);

        /// <summary>
        /// 司机切换工作状态
        /// </summary>
        /// <param name="driverId">司机信息</param>
        /// <param name="workingStatus">工作状态</param>
        /// <returns></returns>
        DriverDto ChangeWorkingStatus(long driverId, DriverWorkingStatusForApp workingStatus);
        /// <summary>
        /// 车辆审核
        /// </summary>
        /// <param name="admin">审核人员</param>
        /// <param name="driverId">当前司机Id</param>
        /// <param name="dto">审核信息</param>
        /// <returns></returns>
        DriverDto VehicleApprove(AdminDto admin, long driverId, ApproveRequestDto dto);
        /// <summary>
        /// 司机修改图像
        /// </summary>
        /// <param name="phone">手机号</param>
        /// <param name="avatar">新图像地址</param>
        /// <returns></returns>
        bool UpdateAvatar(string phone, string avatar);
        /// <summary>
        /// 司机修改昵称
        /// </summary>
        /// <param name="phone">手机号</param>
        /// <param name="petname">新昵称</param>
        /// <returns></returns>
        bool UpdatePetname(string phone, string petname);
        /// <summary>
        /// 获取所有已审批的司机列表
        /// </summary> 
        /// <param name="companyId">总公司/代理商Id</param> 
        /// <returns></returns>
        IEnumerable<DriverDto> GetALLApprovedList(long? companyId);
    }
}
